<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">

        body {
            margin: 0;
            padding: 0;
        }

        .loader {
            position: absolute;
            top: 50%;
            left: 50%;
            height: 200px;
            width: 200px;
            text-align: center;
            line-height: 200px;
            transform: translate(-50%, -50%);
            overflow: hidden;
        }

        .loader h1 {
            z-index: 2;
            position: absolute;
            margin: 0;
            padding: 0;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .loader:before {
            content: "";
            background-color: #00b0ff;
            top: 0;
            position: absolute;
            height: 150%;
            width: 50%;
            animation: animate1 2s linear infinite;
        }

        .loader:after {
            content: "";
            background-color: yellow;
            top: 0;
            position: absolute;
            height: 150%;
            width: 50%;
            animation: animate2 1s linear infinite;
        }

        @keyframes animate1 {
            0% {
                transform: translateY(100%);
                left: 100%;
            }
            100% {
                transform: translateY(-100%);
                left: -50%;
            }
        }

        @keyframes animate2 {
            0% {
                transform: translateY(100%);
                left: -50%;
            }
            100% {
                transform: translateY(-100%);
                left: 100%;
            }
        }

    </style>
</head>
<body>
<div class="loader">
    <h1>loading</h1>
</div>
</body>
</html>